<template>
  <div>
    {{ durationformat($data.data.duration) }}
  </div>
</template>

<script>
import moment from 'moment'

export default {
  data () {
    return {}
  },
  methods: {
    durationformat (item) {
      if (item) {
        let tempTime = moment.duration(item, 'seconds')
        let time = ''
        if (tempTime.asHours() > 0) {
          time += parseInt(tempTime.asHours()) + ':'
        }
        if (tempTime.minutes() > 0) {
          if (tempTime.minutes() < 10) {
            time += '0' + tempTime.minutes()
          } else {
            time += tempTime.minutes()
          }
        }
        if (tempTime.minutes() < 1) {
          time += '00'
        }
        return time
      }
    }
  }
}
</script>

<style>
</style>
